#include <iostream>

using namespace std;

int p1, p2, p3;

int main()
{
	cin >> p1 >> p2 >> p3;
	string s; cin >> s;
	for(int i = 0; i < s.size(); i++)
	{
		if(s[i] != '-') printf("%c", s[i]);
		else
		{ 
			int l = s[i - 1], r = s[i + 1];
			if(l < r && ((l <= '9' && l >= '0') && (r <= '9' && r >= '0') ||
				(l <= 'z' && l >= 'a') && (r <= 'z' && r >= 'a')))
			{
				if(p3 == 1)
			{
				for(int j = l + 1; j < r; j++)
				{
					for(int k = 1; k <= p2; k++)
					{
						if(p1 == 1 || p1 == 2)
						{
							if(l <= '9' && l >= '0')
							{
								printf("%c", j);
							}
							else
							{
								if(p1 == 1)
								{
									char ch = j;
									printf("%c", tolower(ch));
								}
								else
								{
									char ch = j;
									printf("%c", toupper(ch));
								}
							}
						}
						else printf("*");
					}
				}
			}
			else
			{
				for(int j = r - 1; j > l; j--)
				{
					for(int k = 1; k <= p2; k++)
					{
						if(p1 == 1 || p1 == 2)
						{
							if(l <= '9' && l >= '0')
							{
								printf("%c", j);
							}
							else
							{
								if(p1 == 1)
								{
									char ch = j;
									printf("%c", tolower(ch));
								}
								else
								{
									char ch = j;
									printf("%c", toupper(ch));
								}
							}
						}
						else printf("*");
					}
				}
			}
		}
		else
		{
			printf("%c", s[i]);
		}
		}	
			
	}
}
